<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//构造函数
			function Student(name, age) {
				this.name = name;
				this.age = age;
			}

			Student.sex = '男'; //静态属性

			const stu = new Student('张三', 20);

			// console.log(stu.name);
			// console.log(stu.sex);//undefined
			// console.log(Student.sex);

			class Worker {
				constructor(name, age) {
					this.name = name;
					this.age = age;
				}
				static hour = 8;
			}

			const wor = new Worker('张三', 20);
			console.log(wor.name);
			console.log(wor.hour);//undefined
		</script>
	</body>
</html>
